/**
 * @file   shutter.h
 * @author Pedro
 * @date   Thu Nov  6 12:16:36 2008
 * 
 * @brief  Control automático de ganancia, sobre la cara detectada mediante Lucas & Kanade. Ejecución en paralelo con un hilo.
 * 
 * 
 */
#ifndef _SHUTTER_H_
#define _SHUTTER_H_


#include "callbacks.h"

#include "interface.h"
#include "support.h"
#include "serial.h"
#include "../pic_code/PICdata.h"

#include "support.h"
#include "other_functions.h"

#include "frame_header.hh"

#include "interface_capture.h"
#include "captura.h"
#include "socket.h"
#include "face_detect_vj.hh"


#define MEAN_SHUTTER_PIXEL 100.0
#define MIN_VAR_SHUTTER_PIXEL 10.0
#define MAX_VAR_SHUTTER_PIXEL (8/100.0)
#define MIN_SHUTTER 80.0
#define MAX_SHUTTER 1200.0
#define MUL_SHUTTER 2.5

void * pthread_func_lucasycande(void * params);
double gain_control(IplImage *img, CvRect *roi, camera_control *camera, HaarDetector * haar);
void init_gain_control(CvRect *roi, int n, HaarDetector *haar);

#endif
